package com.xiaoyg.lession01.chapter19.endbysleep1;

/**
 * 在sleep状态下停止某一个线程，进入catch语句，并且清除停止状态值，使之变为false
 */
public class MyThread extends Thread {
    @Override
    public void run() {
        super.run();
        try {
            System.out.println("run begin");
            Thread.sleep(2000);
            System.out.println("run end");
        } catch (InterruptedException e) {
            System.out.println("在沉睡中被停止！进入catch！"+this.isInterrupted());
            e.printStackTrace();
        }
    }
}
